import java.util.function.Function;

//@FunctionalInterface
//interface SayHello{
//    String sayHello(String name);
//}

class User{
    private String username;
    private int age;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

//    public String say(SayHello sayHello){
//        return sayHello.sayHello(this.username);
//    }


    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String say(Function<String,String> sayHello){
        return sayHello.apply(this.username);
    }
}

public class LambdaDemo02 {
    public static void main(String[] args) {
        User user = new User();
        user.setUsername("zhang3");
        String say = user.say((username) -> "hello"+username);
        System.out.println("say = "+say);
    }
}
